repo: When writing to a non-root owned repo, chown() objects to match
authorColin Walters <walters@verbum.org>
Tue, 21 Oct 2014 18:34:04 +0000 (14:34 -0400)
committerColin Walters <walters@verbum.org>
Tue, 21 Oct 2014 19:43:43 +0000 (15:43 -0400)
commit5fb8bb955e2b762e0d462d0acd0924cb842f88ab
tree19e7db467540247473730bc1cf666d8b69d80b56
parenta4d904ee38614918d9a7be2a245c179c39661e72
repo: When writing to a non-root owned repo, chown() objects to match

Some package systems need to be run as root, so the process linking to
libostree may also be root.  However, it's reasonable to have the
target repository be owned by a uid other than root.

This patch makes it Just Work by chowning the file content to match.

Note this only operates on archive-z2 repositories, because you can't
usefully serve bare repositories via HTTP.

https://bugzilla.gnome.org/show_bug.cgi?id=738954
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo.c